package com.antgroup.seckill.business.common.enums;

/**
 * @author wangxy
 * @date 2024/8/1 20:40
 */
public enum SequenceNameEnum {

    OS_ORDER("OS_ORDER", "100", "orm apply order's sequence"),
    OS_GOODS("OS_GOODS", "200", "orm apply goods's sequence"),

    OS_SECKILL_ORDER("OS_SECKILL_ORDER", "101", "orm seckill  apply order's sequence");



    /**
     * 场景构造方法
     *
     * @param seq  表名
     * @param code 场景编码
     * @param desc 场景描述
     */
    SequenceNameEnum(String seq,String code, String desc) {
        this.seq = seq;
        this.code = code;
        this.desc = desc;
    }

    /**
     * 根据code获取枚举
     * @param code 编码code
     * @return BusinessTypeEnum
     */
    public static SequenceNameEnum getByCode(String code){
        for(SequenceNameEnum nodeStatus :values()){
            if(nodeStatus.getCode().equals(code)){
                return nodeStatus;
            }
        }
        return null;
    }

    /**
     * 编号
     */
    private String seq;

    /**
     * 场景编码
     */
    private String code;

    /**
     * 场景描述
     */
    private String desc;


    /**
     * Gets the value of seq
     *
     * @return the value of seq
     */
    public String getSeq() {
        return seq;
    }

    /**
     * Sets the seq
     * <p>You can use getSeq() to get the value of seq</p>
     *
     * @param seq seq
     */
    public void setSeq(String seq) {
        this.seq = seq;
    }

    /**
     * Gets the value of code
     *
     * @return the value of code
     */
    public String getCode() {
        return code;
    }

    /**
     * Sets the code
     * <p>You can use getCode() to get the value of code</p>
     *
     * @param code code
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * Gets the value of desc
     *
     * @return the value of desc
     */
    public String getDesc() {
        return desc;
    }

    /**
     * Sets the desc
     * <p>You can use getDesc() to get the value of desc</p>
     *
     * @param desc desc
     */
    public void setDesc(String desc) {
        this.desc = desc;
    }
}
